home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 209 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.0 KB

  1. From: vandevod@cs.rpi.edu (David Vandevoorde)
  2. Message-ID: <xson373y8p4.fsf@avs.cs.rpi.edu>
  3. X-Original-Date: 31 Jan 1996 23:24:23 -0500
  4. Path: in1.uu.net!bounce-back
  5. Date: 01 Feb 96 13:17:00 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: inconsistance in over.over
  9. Organization: RPI Computer Science
  10. References: <4eo2mk$7tc@boy.nmd.msu.ru>
  11. In-Reply-To: krotoff@such.srcc.msu.su's message of 01 Feb 96 01:53:57 GMT
  12. X-Newsreader: Gnus v5.1
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBFAgUBMRC9WuEDnX0m9pzZAQGCmAF9G3u4e086NxWKeVcqKffDEnPRfvYEfvbm
  15.     TZ7PB7Pwuei2UsjvvD80yxFBhf5Yei3G
  16.     =dUqL
  17.  
  18. >>>>> "AK" == Alexander Krotoff <krotoff@such.srcc.msu.su> writes:
  19. [...]
  20. AK> There is small inconsistance in the Oct 95 WP:
  21. AK> -----------------------------------------------------------------------
  22. AK> 13.4    Address of overloaded function    [over.over]
  23. AK> In the example on the end of the section:
  24.  
  25. AK>     int (X::*p5)(int)  = &(X::f);    // error: wrong syntax for</B>
  26. AK>                     // pointer to member</B>
  27. AK>     int    (*p6)(long) = &(X::f);    // OK</B>1
  28.  
  29. AK> Error: qualified-id enclosed in parentheses.
  30. AK> -----------------------------------------------------------------------
  31. AK> 5.3.1    Unary operators            [expr.unary.op]
  32.  
  33. AK> 3    A pointer to member is only formed when an explicit & is used and
  34. AK>     its operand is a qualified-id not enclosed in parentheses.
  35. AK> -----------------------------------------------------------------------
  36.  
  37. AK> I suppose the error is in the over.over.
  38.  
  39. I fail to see the problem. 5.3.1 (which you quote correctly) says that
  40. &X::f could be a pointer to member, but not &(X::f); so that explains
  41. the error in 13.4. &(X::f) resolves to the pointer to a static member
  42. function (which is a pointer to a regular function) in that same
  43. example, so that's fine. Note that the target type resolves the overload.
  44.  
  45.     Daveed
  46. ---
  47. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  48.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  49.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  50.